//
//  LYHTabBarController.m
//  微考
//
//  Created by BrianLiu on 2017/5/11.
//  Copyright © 2017年 BrianLiu. All rights reserved.
//

#import "LYHTabBarController.h"
#import "LYHExamViewController.h"
#import "LYHHomeTableViewController.h"
#import "LYHMeController.h"


@interface LYHTabBarController ()

@end

@implementation LYHTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setUpChildViewController];
}

-(void)setUpChildViewController{
    // 首页
    LYHHomeTableViewController * vc1 = [[LYHHomeTableViewController alloc]init];
    vc1.view.backgroundColor = [UIColor redColor];
    UINavigationController * nav1 = [[UINavigationController alloc]initWithRootViewController:vc1];
    [self addChildViewController:nav1];
    nav1.tabBarItem.title = @"首页";
    [nav1.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor]} forState:UIControlStateNormal];
    [nav1.tabBarItem setImage:[UIImage imageNamed:@"tabBar_essence_icon"]];
    [nav1.tabBarItem setSelectedImage:[UIImage imageNamed:@"tabBar_essence_click_icon"]];
    // 考试
    LYHExamViewController * vc2 = [[LYHExamViewController alloc]init];
    vc2.view.backgroundColor = [UIColor greenColor];
    UINavigationController * nav2 = [[UINavigationController alloc]initWithRootViewController:vc2];
    [self addChildViewController:nav2];
    nav2.tabBarItem.title = @"考试口令";
    [nav2.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor]} forState:UIControlStateNormal];
    [nav2.tabBarItem setImage:[UIImage imageNamed:@"tabBar_new_icon"]];
    [nav2.tabBarItem setSelectedImage:[UIImage imageNamed:@"tabBar_new_click_icon"]];
    // 我的
    LYHMeController * vc3 = [[LYHMeController alloc]init];
    vc3.view.backgroundColor = [UIColor lightGrayColor];
    UINavigationController * nav3 = [[UINavigationController alloc]initWithRootViewController:vc3];
    [self addChildViewController:nav3];
    nav3.tabBarItem.title = @"我的";
    [nav3.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor blackColor]} forState:UIControlStateNormal];
    [nav3.tabBarItem setImage:[UIImage imageNamed:@"tabBar_me_icon"]];
    [nav3.tabBarItem setSelectedImage:[UIImage imageNamed:@"tabBar_me_click_icon"]];

}
    
    

@end
